#ifndef PROFILEDELEGATE_H
#define PROFILEDELEGATE_H

#include <QStyledItemDelegate>
#include <QComboBox>
#include <QPushButton>

#define DelegateUpadateProgress QEvent::User+1

class ProfileDelegate : public QStyledItemDelegate
{
    Q_OBJECT
public:
    ProfileDelegate();
    ~ProfileDelegate();
    QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const;
    void setEditorData(QWidget *editor, const QModelIndex &index) const;
    void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const;
    void updateEditorGeometry(QWidget* editor, const QStyleOptionViewItem& option, const QModelIndex& index ) const;

public slots:
    void        SaveItem();
    void        LoadItemFromFile();
    void        CreateProgressBar(int row);
    void        DeleteProgressBar(int row);
    void        RowRemoved(int row);
    void        RowAdd(int row);
signals:

private:
    QStringList     provider_names;
    QList<int>      *balancePercents;
    QList<bool>     *balanceInProgress;
};

#endif // PROFILEDELEGATE_H
